<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #xdd{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
    
</head>
<body>
    <div id="xdd"></div>
    
    <script>
        // 当点击xdd的时候，2s后，xdd的背景颜色变为蓝色
        let xdd = document.getElementById('xdd');
        xdd.onclick = function () {
            setTimeout(() => {
                this.style.backgroundColor = 'blue';
                console.log(this);
            }, 2000); 
        }
    </script>
    
</body>
</html>